import {createRouter,createWebHistory} from 'vue-router'
//导入组件
import LoginVue from '@/Views/Login.vue'
import adminLayout from "@/views/adminLayout.vue";
import customerLayout from "@/views/customerLayout.vue"
import landlordLayout from "@/views/landlordLayout.vue"
import intermediaryLayout from "@/views/intermediaryLayout.vue"


import UserAvatarVue from "@/views/user/UserAvatar.vue";
import UserInfoVue from "@/views/user/UserInfo.vue";
import UserResetPasswordVue from "@/views/user/UserResetPassword.vue";
import AdminIndex from "@/views/workBench/AdminIndex.vue";
import BuyHouseslist from "@/views/buyHouses/BuyHouseslist.vue";
import RentingHouseslist from "@/views/RentingHouses/RentingHouseslist.vue";
import UserManagementlist from "@/views/userManagement/UserManagementlist.vue";
import NoticeManagementlist from "@/views/noticeManagement/NoticeManagementlist.vue";
import FinancialManagementlist from "@/views/financialManagement/FinancialManagementlist.vue";
import HousesManagementlist from "@/views/housesResoures/HousesManagementlist.vue";

import CustomerIndex from "@/views/workBench/customerIndex.vue";
import NoticeManagementCuslist from "@/views/noticeManagement/NoticeManagementCuslist.vue";
import BuyHousesCuslist from "@/views/buyHouses/BuyHousesCuslist.vue";
import RentingHousesCuslist from "@/views/RentingHouses/RentingHousesCuslist.vue";
import UserAvatarCus from "@/views/userCus/UserAvatarCus.vue";
import UserInfoCus from "@/views/userCus/UserInfoCus.vue";
import UserResetPasswordCus from "@/views/userCus/UserResetPasswordCus.vue";


import LandlordIndex from "@/views/workBench/LandlordIndex.vue";
import SellHousesLanlist from "@/views/buyHouses/SellHousesLanlist.vue";
import RentingHousesLanlist from "@/views/RentingHouses/RentingHousesLanlist.vue";
import NoticeManagementLanlist from "@/views/noticeManagement/NoticeManagementLanlist.vue";
import UserAvatarLan from "@/views/userLan/UserAvatarLan.vue";
import UserInfoLan from "@/views/userLan/UserInfoLan.vue";
import UserResetPasswordLan from "@/views/userLan/UserResetPasswordLan.vue";


import IntermediaryIndex from "@/views/workBench/IntermediaryIndex.vue";
import NoticeManagementIntlist from "@/views/noticeManagement/NoticeManagementIntlist.vue";
import CustomerInfo from "@/views/userInformation/CustomerInfo.vue";
import LandlordInfo from "@/views/userInformation/LandlordInfo.vue";
import ContractelegationList from "@/views/contractDelegation/ContractelegationList.vue";
import FinancialManagementIntlist from "@/views/financialManagement/FinancialManagementIntlist.vue";
import UserAvatarInt from "@/views/userInt/UserAvatarInt.vue";
import UserInfoInt from "@/views/userInt/UserInfoInt.vue";
import UserResetPasswordInt from "@/views/userInt/UserResetPasswordInt.vue";

import BuyHousesIntlist from "@/views/buyHouses/BuyHousesIntlist.vue";
import RentingHousesIntlist from "@/views/RentingHouses/RentingHousesIntlist.vue";

import housesItemDetail from "@/views/housesResoures/modules/housesItemDetail.vue";
import housesItemBuyDetail from "@/views/buyHouses/modules/housesItemBuyDetail.vue"
import housesItemResDetail from "@/views/RentingHouses/modules/housesItemResDetail.vue"

import housesItemCusBuyDetail from "@/views/buyHouses/modules/housesItemCusBuyDetail.vue"
import housesItemCusResDetail from "@/views/RentingHouses/modules/housesItemCusResDetail.vue"

import housesItemLanBuyDetail from "@/views/buyHouses/modules/housesItemLanBuyDetail.vue"
import housesItemLanResDetail from "@/views/RentingHouses/modules/housesItemLanResDetail.vue"

import housesItemIntBuyDetail from "@/views/buyHouses/modules/housesItemIntBuyDetail.vue"
import housesItemIntResDetail from "@/views/RentingHouses/modules/housesItemIntResDetail.vue"
import ContractelegationAdmList from "@/views/contractDelegation/ContractelegationAdmList.vue";


//定义路由
const routes =[
    {path:'/',component:LoginVue},
    {
        path:'/admin',
        component:adminLayout,
        redirect:'/workBench/AdminIndex',
        children:[
            {path:'/workBench/AdminIndex',component:AdminIndex},
            {path:'/housesResoures/HousesManagementlist', component:HousesManagementlist},

            {path:'/contractDelegation/ContractelegationAdmList', component:ContractelegationAdmList},

            {path: '/housesItemDetail/:id',name: 'housesItemDetail', component: housesItemDetail},
            {path: '/housesItemDetailBuy/:id',name: 'housesItemDetailBuy', component: housesItemBuyDetail},
            {path: '/housesItemDetailRes/:id',name: 'housesItemDetailRes', component: housesItemResDetail},

            {path:'/buyHouses/BuyHouseslist',component:BuyHouseslist},
            {path:'/RentingHouses/RentingHouseslist',component:RentingHouseslist},
            {path:'/RentingHouses/RentingHouseslistadm/:communityId',name: 'RentingHouseslistadm',component:RentingHouseslist},

            {path:'/userManagement/UserManagementlist',component:UserManagementlist},
            {path:'/noticeManagement/NoticeManagementlist',component:NoticeManagementlist},
            {path:'/financialManagement/FinancialManagementlist',component:FinancialManagementlist},
            {path:'/user/info',component:UserInfoVue},
            {path:'/user/avatar',component:UserAvatarVue},
            {path:'/user/resetPassword',component:UserResetPasswordVue},


        ]
    },
    {
        path:'/customer',
        component:customerLayout,
        redirect:'/workBench/customerIndex',
        children:[
            {path:'/workBench/customerIndex',component:CustomerIndex},
            {path:'/buyHouses/BuyHousesCuslist',component:BuyHousesCuslist},
            {path:'/RentingHouses/RentingHousesCuslist',component:RentingHousesCuslist},
            {path:'/RentingHouses/RentingHousesCuslistCus/:communityId',name: 'RentingHousesCuslistCus',component:RentingHousesCuslist},
            {path:'/noticeManagement/NoticeManagementCuslist',component:NoticeManagementCuslist},
            {path:'/userCus/UserInfoCus',component:UserInfoCus},
            {path:'/userCus/UserAvatarCus',component:UserAvatarCus},
            {path:'/userCus/UserResetPasswordCus',component:UserResetPasswordCus},

            {path: '/housesItemDetailCurBuy/:id/:IntType',name: 'housesItemDetailCusBuy', component: housesItemCusBuyDetail},
            {path: '/housesItemDetailCurRes/:id/:IntType',name: 'housesItemDetailCusRes', component: housesItemCusResDetail},

        ]
    },
    {
        path:'/landlord',
        component:landlordLayout,
        redirect:'/workBench/LandlordIndex',
        children:[
            {path:'/workBench/LandlordIndex',component:LandlordIndex},
            {path:'/buyHouses/SellHousesLanlist',component:SellHousesLanlist},
            {path:'/RentingHouses/RentingHousesLanlist',component:RentingHousesLanlist},
            {path:'/RentingHouses/RentingHousesLanlistLan/:communityId',name: 'RentingHousesLanlistLan',component:RentingHousesLanlist},
            {path:'/noticeManagement/NoticeManagementLanlist',component:NoticeManagementLanlist},
            {path:'/userLan/UserInfoLan',component:UserInfoLan},
            {path:'/userLan/UserAvatarLan',component:UserAvatarLan},
            {path:'/userLan/UserResetPasswordLan',component:UserResetPasswordLan},

            {path: '/housesItemDetailLanBuy/:id',name: 'housesItemDetailLanBuy', component: housesItemLanBuyDetail},
            {path: '/housesItemDetailLanRes/:id',name: 'housesItemDetailLanRes', component: housesItemLanResDetail},
        ]
    },
    {
        path:'/intermediary',
        component:intermediaryLayout,
        redirect:'/workBench/IntermediaryIndex',
        children:[
            {path:'/workBench/IntermediaryIndex',component:IntermediaryIndex},
            {path:'/buyHouses/BuyHousesIntlist',component:BuyHousesIntlist},
            {path:'/RentingHouses/RentingHousesIntlist',component:RentingHousesIntlist},
            {path:'/RentingHouses/RentingHousesLanlistInt/:communityId',name: 'RentingHousesLanlistInt',component:RentingHousesIntlist},
            {path:'/noticeManagement/NoticeManagementIntlist',component:NoticeManagementIntlist},
            {path:'/userInformation/CustomerInfo',component:CustomerInfo},
            {path:'/userInformation/LandlordInfo',component:LandlordInfo},
            {path:'/contractDelegation/ContractelegationList',component:ContractelegationList},
            {path:'/financialManagement/FinancialManagementIntlist',component:FinancialManagementIntlist},
            {path:'/userInt/UserInfoInt',component:UserInfoInt},
            {path:'/userInt/UserAvatarInt',component:UserAvatarInt},
            {path:'/userInt/UserResetPasswordInt',component:UserResetPasswordInt},

            {path: '/housesItemDetailIntBuy/:id/:IntType',name: 'housesItemDetailIntBuy', component: housesItemIntBuyDetail},
            {path: '/housesItemDetailIntRes/:id/:IntType',name: 'housesItemDetailIntRes', component: housesItemIntResDetail},
        ]
    }
]

//创建路由器
const router = createRouter({
    history:createWebHistory(),
    routes:routes
})

//导出路由
export default router
